package com.learn.annotation_config.bean;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;

@ComponentScan
@PropertySource("classpath:application.properties")
public class BeanApplication {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(BeanApplication.class);
        System.out.println(applicationContext.getBean("dataSource"));
        System.out.println(applicationContext.getBean("formatDate"));
        applicationContext.close();
    }
}
